workFolder = "C:\Users\walsworthlab\Desktop\jstang\RandomCurrentGeneration\currentdensity_raw_trial2\";
workFolder = "C:\Users\walsworthlab\Desktop\jstang\RandomCurrentGeneration\meshimg_raw_trial2\";
workFolder = "C:\Users\walsworthlab\Desktop\jstang\RandomCurrentGeneration\currentdensity_raw_trial2_compressed\";
% workFolder = "C:\Users\walsworthlab\Desktop\jstang\RandomCurrentGeneration\test_trial1\praticerename\";
dataappendix = ".txt";
% dataappendix = ".png";
fileNames = dir(workFolder+"*"+dataappendix);
fileNums = size(fileNames,1);

toNamels = linspace(1, fileNums, fileNums);
for id = toNamels
    disp("working on/total")
    disp([id,fileNums])
    originalName = [fileNames(id).folder,'\',fileNames(id).name];
    reName = [fileNames(id).folder,'\',char(num2str(id,'%04.f')+dataappendix)];
    if isfile(reName)
        disp("pass")
        continue
    else
        movefile(originalName, reName); 
        disp("rename")
    end
end